<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <!--公共样式-->
    <link href="${pageContext.request.contextPath }/web/css/font/iconfont.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/web/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/NormalizeFile.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/public.css" />
    <!--列表页面私有样式-->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/subpage/FlowerCatalog.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/subpage/details.css" />
</head>
<body style="background:#dddddd;">
    <!--花型目录 begin-->
            <div class="flower-sel">
            <input type="hidden" id="testUrl" value="${patternlist[0].pImg}"/>
                <ul>
                <c:forEach items="${patternlist}" var="item">
                    <li>
                        <a href="javascript:void(0);" onclick="getInfo(${item.pId},${item.pVip});">
                        	<img src="${pageContext.request.contextPath }/upload/compression/${item.pImg}" />
                        	<c:if test="${item.pVip==2 }">
								<span class="serial-vip2" style="top: 95px;left: 50px;">VIP</span>
							</c:if>
                        </a>
                    </li>
                 </c:forEach>
                </ul>
            </div>
    <!--全局-->
    <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/public.js"></script>
    <!--ie789下placeholder不兼容-->
    <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/placeholder.js"></script>
    <!--头部的以图搜图-->
    <%-- <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/uppicFile.js"></script> --%>
    <script>
    	
        /*选服装类型*/
        $(".tab  ul.cate-li li").click(function () {
            $(".tab  ul.cate-li li").eq($(this).index()).addClass("on-cate").siblings().removeClass('on-cate');
        });
        
        function getInfo(pId,vip){
        	if(vip==2){
    			$.ajax({
    				url:'${pageContext.request.contextPath }/web/patternfilter/judge', 
    				async : false,
    				type : "POST",  
    				success :function(result){
		       			var status=result.msg.status;
		       			var desc=result.msg.desc;
	       			    if(status == 1){//没登录
	       			    	layer.confirm('<spring:message code="flowertypecatalog.notLogin"></spring:message>', {
	    			        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
	    			        	  title:'<spring:message code="flowertypecatalog.message"></spring:message>'
	    			        	}, function(index){
	    			        		location.href="${pageContext.request.contextPath}/web/member/login";
	    			        	},function(index){
	    			        		
	    			        	});
	       			    	flag=true;
	       			    }else if(status ==2){
	       			    	layer.confirm('<spring:message code="flowertypecatalog.applyForVIP"></spring:message>', {
	       			        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
	       			        	  title:'<spring:message code="flowertypecatalog.message"></spring:message>'
	       			        	}, function(index){
	       			        		location.href="${pageContext.request.contextPath}/web/vip/applicationForVIP";
	       			        		layer.close(index);
	       			        	},function(index){
	       			        		layer.close(index);
	       			        	});
	       			    	
	       			    }else{
	       			    	top.location.href='${pageContext.request.contextPath}/web/pattern/flowerCatalog?id='+pId;
	       			    }
       		  		}
    			});
   			}else{
   				$.ajax({
   					url:'${pageContext.request.contextPath }/web/patternfilter/judge', 
   					async : false,
   					type : "POST",  
   					success :function(result){
   		   			 	var status=result.msg.status;
   		   			 	var desc=result.msg.desc;
   		   			    if(status == 1){//没登录
   		   			    	layer.confirm('<spring:message code="flowertypecatalog.notLogin"></spring:message>', {
   		   			        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
   		   			        	title:'<spring:message code="flowertypecatalog.message"></spring:message>'
   		   			        	}, function(index){
   		   			        		location.href="${pageContext.request.contextPath}/web/member/login";
   		   			        	},function(index){
   		   			        		
   		   			        	});
   		   			    	
   		   			    }else{
   		   			    	top.location.href='${pageContext.request.contextPath}/web/pattern/flowerCatalog?id='+pId;
   		   			    }
   					}
   				});
   			}
        }
    </script>

</body>
</html>